Skip to content

Conversation

@lbarbisan
Copy link

@lbarbisan lbarbisan commented May 28, 2025

I'm using this custom component to track power consumption (only) :

image

I can't use change based publishing events because watt computation will be wrong (ie. instant watt sensors are giving per hour consumption each time watt value is changing, due to this you can't retrieve properly the consumption) .

So had to disable publish on change and use polling every 10 sec to be sure at least power consumption higher than 10 sec is recorded into elasticsearch. Then divide in kibana all values received by 360 (ie. Number of events sent during one hour at a 10 sec rate) to be sure I'm computing the correct power consumption.

The issue with this approach is we receive a lot of events most of them being 0. As I'm in a power consumption scenario I don't care about zero I need a way to ignore them.

Change-Id: I2a4a778792659228ad9b636bd7ae08809626a4f0
Copy link
Owner

@legrego legrego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @lbarbisan,

Thanks for taking the time to raise a PR for your issue, I appreciate the contribution.

Would it be feasible to use a custom ingest pipeline (https://legrego.github.io/homeassistant-elasticsearch/ingest_advanced/#custom-ingest-pipeline) to drop events with a 0 value?

I've learned from prior versions of this component that adding new config options begets more config options ("...but what about my edge case to {some setting}?"). For this reason, I'm hesitant to add additional config options unless there is appreciable benefit across many users / use cases.

@lbarbisan
Copy link
Author

lbarbisan commented Jun 14, 2025

Thanks for taking the time to review my pull request.

I didn't want to do that initially beacuse my ES instance and kibana are not backuped (while my HA conf is). Rebuilding a vanilla kibana/ES dev instance from scratch is easy. but not all those tiny little config you put here and there espacially when they are stored in database and not file based. I guess I will add yet an other manual step in my recovery procedure.

I'm fine to go with something else as the more option you put in a product the more complex it becomes to test and maintain. Indeed if I'm the only one needing such thing there is no point. Also to make this change better it would require to do this only on electricy based sensors may be (ie. you don't want to filter temperature for exemple) or provide a more complex filtering conditions, or this inject custome_template at indices creation. So this pull request as is I agree won't fly.

There might be an other way in HA to filter events sent to this maybe. don't know.

You can close this request if you think it doesn't make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants